const state = {
  showFooter: true,
  changeNum: 0
}

const getters = {
  isShow(state) {
    return state.showFooter
  },
  getChangeNum() {
    return state.changeNum
  }
}

const mutations = {
  show(state) {
    state.showFooter = true
  },
  hide(state) {
    state.showFooter = false
  },
  newNum(state, sum) {
    state.changeNum += sum
  }
}

const actions = {
  hideFooter(context) {
    context.commit('hide')
  },
  showFooter(context) {
    context.commit('show')
  },
  getNem(context, num) {
    context.commit('newNum', num)
  }
}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}